package com.hps.zipkinconsumer.controller;

import com.hps.zipkinconsumer.entity.User;
import com.hps.zipkinconsumer.service.client.UserClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author heps
 * @date 2019/1/8 9:45
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    private static final Logger LOGGER = LoggerFactory.getLogger(HelloController.class);

    private UserClient userClient;

    public HelloController(UserClient userClient) {
        this.userClient = userClient;
    }

    @GetMapping
    public User hello() {
        LOGGER.debug("ok");
        return userClient.find();
    }
}
